<div class = "full_width">
	<h3>Tạo danh mục mới</h3>
	<?php echo $this->Form->create(array('controller' => 'categories', 'action' => 'add'));?>
	<?php echo $this->Form->input('name', array('label' => 'Tên danh mục	', 'size' => '80'));?>
	<?php echo $this->Form->end(__('Thêm', true));?>

</div>

<div class= "full_width">
	<h3><?php __('Danh sách danh mục');?></h3>
	<p>
		<?php
		echo $this->Paginator->counter(array(
		'format' => __('Có tổng cộng %count% danh mục', true)
		));
		?>	
	</p>
	<table cellpadding="0" cellspacing="0">
	<tr>
			<th><?php echo $this->Paginator->sort('Tên','name');?></th>
			<th>Số bài viết</th>
			<th class="actions">Thao tác</th>
	</tr>
	<?php
	$i = 0;
	foreach ($categories as $category):	?>
	<tr>
		<td><?php echo $category['Category']['name']; ?>&nbsp;</td>
		<td><?php echo count($category['Post']); ?></td>
		<td class="actions">
			<?php echo $this->Html->link($html->image('admin/icons/edit.png'), array('action' => 'edit', $category['Category']['id']), array('escape' => false, 'title' => 'Sửa tên chuyên mục')); ?>
			<?php echo $this->Html->link($html->image('admin/icons/delete.png'), array('action' => 'delete', $category['Category']['id']), array('escape' => false, 'title' => 'Xóa chuyên mục'), sprintf(__('Bạn có chắc muốn xóa chuyên mục [%s]?', true), $category['Category']['name'])); ?>
		</td>
	</tr>
	<?php endforeach; ?>
	</table>
	<div class="paging">
		<?php echo $this->Paginator->prev('<< ' . __('previous', true), array(), null, array('class'=>'disabled'));?>
	 | 	<?php echo $this->Paginator->numbers();?>
 |
		<?php echo $this->Paginator->next(__('next', true) . ' >>', array(), null, array('class' => 'disabled'));?>
	</div>
</div>
